<?php
require_once ("../dao/AdvertiseDAO.php");
$action = $_POST['act'];
$result = false;
if($action == 'lock') {
	if(isset($_POST['idre'])) {
		$id = $_POST['idre'];
		if(deleteAdvertise($id, '0')) {
			$result = true;
		}
	}
	
} else if($action == 'unlock') {
	if(isset($_POST['idre'])) {
		$id = $_POST['idre'];
		if(deleteAdvertise($id, '1')) {
			$result = true;
		}
	}
} else if($action == 'del') {
	if(isset($_POST['idpe'])) {
		$id = $_POST['idpe'];
		if(removeAdvertise($id)) {
			$result = true;
		}
	}
}
echo json_encode($result);
?>